<fieldset>
    <legend>条件搜索</legend>
    <form style="float: left" class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">客户名称</label>
            <div class="layui-input-inline">
                <input name="customer_name" value="{:input('get.customer_name')}" placeholder="请输入客户名称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">客户昵称</label>
            <div class="layui-input-inline">
                <input name="nickname" value="{:input('get.nickname')}" placeholder="请输入客户昵称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">陪玩项目/送礼</label>
            <div class="layui-input-inline">
                <input name="activity_gift" value="{:input('get.activity_gift')}" placeholder="请输入陪玩项目" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">电源</label>
            <div class="layui-input-inline">
                <input name="power_source" value="{:input('get.power_source')}" placeholder="请输入电源" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">接待</label>
            <div class="layui-input-inline">
                <input name="receptionist" value="{:input('get.receptionist')}" placeholder="请输入接待" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">收款</label>
            <div class="layui-input-inline">
                <input name="collector" value="{:input('get.collector')}" placeholder="请输入收款" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">营业金额</label>
            <div class="layui-input-inline">
                <input name="business_amount" value="{:input('get.business_amount')}" placeholder="请输入营业金额" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">订单状态</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="status" lay-search>
                    <option value="" >全部</option>
                    <option value="1" {if input('get.status') == 1}selected {/if}>正常</option>
                    <option value="2" {if input('get.status') == 2}selected {/if}>退单</option>
                </select>
            </div>
        </div>


        <div class="layui-form-item layui-inline">
            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
            <button class="layui-btn layui-bg-blue" style="border: none" data-file data-field="file">导入</button>
            <button data-action='{:url("remove")}' data-rule="id#{key}"  data-confirm="确定要删除这些吗？" class='layui-btn layui-btn-sm layui-btn-danger'>批量删除</button>
            <button class="layui-btn layui-btn-danger" data-confirm="确认要清空数据吗?清空后无法恢复" data-action="{:url('delall')}" >清空数据</button>
<!--            <button class="layui-btn layui-bg-blue" style="border: none" data-modal="{:url('updatacustomer')}">计算</button>-->
<!--            <input type="hidden" name="file">-->
        </div>
    </form>
</fieldset>
<script>
    $(function () {
        /*！捕获文件上传结果 */
        // $('[name=file]').on('change', function () {
        //     // 文件地址变量事件
        //     console.log(this.value)
        // });

        /*！文件上传过程及事件处理 */
        $('[data-file]').on('upload.choose', function (files) {
            // 文件选择后的事件
        }).on('upload.hash', function (event, file) {
            // file 当前文件对象
        }).on('upload.progress', function (event, obj) {
            // obj.file 当前文件对象
            // obj.event 文件上传进度事件
            // obj.number 当前上传进度值
        }).on('upload.done', function (event, obj) {
            // obj.file 当前完成的文件对象，每个文件上传成功将会调用
            // obj.data 当前文件上传后服务端返回的内容，部分云上传不会返回数据
            console.log("done",obj)
            $.ajax({
                url: "{:url('importorder')}",
                data:{data:obj.file.xpath},
                type:'post',
                success:function (res) {
                    if(res.code == 1){
                        $.msg.success("任务创建成功",1,$.loadQueue(res.data))


                    }else{
                       $.msg.error("任务创建失败")
                    }
               }
            })


        }).on('upload.complete', function (event) {
            // 全部文件上传成功
        });
    });
</script>
